using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Ivory;
using Schism;

namespace Defender
{
    public class Launcher : Microsoft.Xna.Framework.Game
    {
        ScreenManager Manager;

        public Launcher()
        {
            Content.RootDirectory = "Content";
            Manager = new ScreenManager(this, "data/config.cfg");
            ObjectHolder.GameObject = this;
        }

        protected override void Initialize()
        {
            Manager.SetMainMenu(new MainMenu(this));
            Manager.AddGameScreen(LevelRunner.Key, new LevelRunner());
            Manager.AddGameScreen(LevelEditor.Key, new LevelEditor());
            Manager.AddGameScreen(LevelMappingTest.Key, new LevelMappingTest());

            base.Initialize();
        }
        protected override void LoadContent()
        {
            Manager.LoadScreenManager();
        }

        protected override void Update(GameTime gameTime)
        {
            Manager.Update(gameTime);
            base.Update(gameTime);
        }
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            Manager.Draw(gameTime);

            base.Draw(gameTime);
        }
    }
}
